-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to boxo with refactored providerQueryManager. #10595
base: master
Are you sure you want to change the base?
Conversation
e949039
to
2012782
Compare
This is testing ipfs/boxo#641 |
ecb88f2
to
f46134c
Compare
@aschmahmann I have a problem: before, bitswap reprovided new blocks "immediately". Now, they are sent to the reprovider.System, which reprovides them when it likes, but not immediately. The question is:
Opinions? |
@hsanjuan would you agree that this change in behavior seems more like a test issue than a production one? If so then what we do next seems like a matter of expediency vs maintenance. For some of these tests it'd probably be nice to confirm that automatic providing works so we know if something breaks later. The reason this isn't working in tests is because this option https://github.com/ipfs/boxo/blob/c91cc1d5a0552c653936bd5051b6c0972d57743c/provider/reprovider.go#L226 (which is not exposed except for tests) defaults to waiting for 1 minute of uptime before providing to prevent wasted effort (e.g. if people run So there are some other options as well:
Not sure which option makes the most sense, part of me says that we should do whatever behavior we want to see normal users experience and compromise on if there's some grossness in the final binary / code related to testing (e.g. using the Internal config section or a test config section). |
I can fix the failing tests by manually calling "ipfs bitswap reprovide" after adding. What I'm wondering is whether users expect that after running "ipfs add", the new content should be provided immediately (because they add and then try to open it on the gateway etc). There are also a number of underlying issues:
Perhaps the best is to trigger a re-provide right after adding something... but perhaps that provides other things first so it's also not perfect. |
229a670
to
47a8cf0
Compare
47a8cf0
to
936da81
Compare
After a quick discussion: what is happening is that the reprovider has an initialDelay and that's it. Otherwise it is going to provide blocks very quickly just like it happened below, except better. So the solution is to call Reprovide on the tests that need it by hand and move on. |
func OnlineExchange() interface{} { | ||
return func(in *bitswap.Bitswap, lc fx.Lifecycle) exchange.Interface { | ||
lc.Append(fx.Hook{ | ||
OnStop: func(ctx context.Context) error { | ||
return in.Close() | ||
}, | ||
}) | ||
return in | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One day this might be not just bitswap, but bitswap + http etc.
if res.Err != nil { | ||
t.Fatal(res.Err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: use require
here and in other tests.
if res.Err != nil { | |
t.Fatal(res.Err) | |
} | |
require.NoError(t, res.Err) |
No description provided.